<template>
  <mu-table ref="tableRef" v-bind="tableProps"></mu-table>
</template>

<script setup lang="ts">
import MuTable from '@/components/MuTable/MuTable.vue'
import type { IProps } from '@/components/MuTable/prop.ts'
import { ref, onMounted } from 'vue'

onMounted(() => {
  tableRef.value?.load()
})
const tableRef = ref<InstanceType<typeof MuTable>>()
const tableProps: IProps = {
  queryFilter: [
    { name: 'name', label: '名称', type: 'ElInput' },
    { name: 'code', label: '标题', type: 'ElInput' },
    { name: 'deptName', label: '部门', type: 'ElInput' },
    { name: 'aaa', label: '内容', type: 'ElInput' },
    { name: 'ddd', label: '选择日期', type: 'ElDatePicker', props: { type: 'daterange' } },
    { name: 'abcd', label: 'asdf', type: 'ElInput' },
  ],
  table: {
    id: 'testTable12312312312',
    url: '/api/test-list',
    columns: [
      { type:'seq', width: 70 },
      { field: 'name', title: '名称' },
      { field: 'code', title: 'code' },
      { field: 'deptName', title: 'deptName' },
      { field: 'enabled', title: 'enabled' },
    ]
  }
}

</script>

<style scoped>

</style>